{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}
{script src=js/tablesorter.js}
<div class="ag_postwrap">
	<div class="ag_rightend">
		<h2 class="ag_headerbar"><span class="ag_middle">##Section attachments##</span></h2>
	</div>

	<div class="ag_tablewrap">
		{if count($files) > 0}
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tablesorter" id="table_sort">
			<thead>
				<tr>
					<th class="ag_spacer"><a href="#" onclick="return false;">##extension##</a></th>
					<th class="ag_spacer"><a href="#" onclick="return false;">##name##</a></th>
					<th class="ag_spacer"><a href="#" onclick="return false;">##download##</a></th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="3" class="ag_spacer">
						<div id="ag_pager" class="ag_pager">
							<form action="">
								<img src="{$root_url}/style/{$style}/js_css/img/first.png" class="first" alt="##First##" title="##First##" onclick="sorter.move(-1,true)" />
								<img src="{$root_url}/style/{$style}/js_css/img/prev.png" class="prev" alt="##Previous##" title="##Previous##" onclick="sorter.move(-1)" />
								<img src="{$root_url}/style/{$style}/js_css/img/next.png" class="next" alt="##Next##" title="##Next##" onclick="sorter.move(1)" />
								<img src="{$root_url}/style/{$style}/js_css/img/last.png" class="last" alt="##Last##" title="##Last##" onclick="sorter.move(1,true)" />
								<select onchange="sorter.size(this.value)">
									<option value="5">5</option>
									<option selected="selected" value="10">10</option>
									<option value="20">20</option>
									<option value="30">30</option>
									<option value="40">40</option>
									<option value="50">50</option>
									<option value="100">100</option>
								</select>
								<span id="text">##Page## <span id="currentpage"></span>/<span id="pagelimit"></span></span>
							</form>
						</div>
					</td>
				</tr>
			</tfoot>
			<tbody>
				{if count($files) > 0}
				{capture assign=fileCount}1{/capture}
				{foreach from=$files item=file}
				<tr>
					<td class="ag_spacer" id="ag_att_ext-{$fileCount}" style="ag_att_ext">
						{$file->ext}
					</td>
					<td class="ag_column" id="ag_att_name-{$fileCount}" style="ag_att_name">
						{$file->name}
					</td>
					<td class="ag_spacer" id="ag_att_download-{$fileCount}" style="ag_att_download">
						<a href="{url task=profile page=attachments action=download user_id=$user_id file=$file->link}" title="##download##">
							<img src="{$root_url}/style/{$style}/js_css/img/download.png" alt="##Download##" />
						</a>
					</td>
				</tr>
				<!-- /{$fileCount++} -->
				{/foreach}
				{/if}
			</tbody>
		</table>
		{/if}
		<div class="ag_clearer"></div>
	</div>
</div>
<script type="text/javascript">
<!--
var sorter = new TINY.table.sorter("sorter");
sorter.head = "head";
sorter.asc = "asc";
sorter.desc = "desc";
sorter.even = "evenrow";
sorter.odd = "oddrow";
sorter.evensel = "evenselected";
sorter.oddsel = "oddselected";
sorter.paginate = true;
sorter.currentid = "currentpage";
sorter.limitid = "pagelimit";
sorter.init("table_sort",1);
//-->
</script>